function setTrBgcolor(obj,types,bgtypes) {
    if(types == 1) {
        obj.style.background = "#999999";
    }
    else {
        if(bgtypes == 1) {
            obj.style.background = "#F6F6F6";
        }
        else {
            obj.style.background = "";
        }
    }
}


function tunePage(toPageNo,pageNo) {
    try {
        var topage = 1;
        if(typeof(toPageNo) != "number" || toPageNo < 1) topage = 1;
        else topage = toPageNo;	
        var olds = window.location.search;
        if(typeof(pageNo) == "undefined" || pageNo == "") pageNo = "pageNo";
        var news = "";
        if(olds.length > 1) {
            olds = olds.substring(1,olds.length);
            var arrays = olds.split("&");
            for (var i = 0; i < arrays.length ; i++)
            {
                if(arrays[i].indexOf(pageNo + "=") < 0 && arrays[i].length > 1) {
                    news += "&" + arrays[i];
                }
            }
            if(news.length > 1) {
                news = "?" + news.substring(1,news.length) + "&" + pageNo + "=" + topage;
            }
            else {
                news = "?" + pageNo + "=" + topage;
            }
        }
        else {
            news = "?" + pageNo + "=" + topage;
        }
        window.location = window.location.pathname + news;
    }
    catch(e) {
        window.location = window.location.pathname + window.location.search;
    }
}

function sAll(thisObj,dObj) {
    try {
        var l = eval(dObj + ".length");
        if(typeof(l) == "undefined") {
            eval(dObj).checked = thisObj.checked;
        }
        else {
            for(var i = 0; i < l; i++) {
                if(!eval(dObj + "[" + i + "]").disabled) eval(dObj + "[" + i + "]").checked = thisObj.checked;
            }
        }
    }
    catch(e){}
}

function sReverse(dObj) {
    try {
        var l = eval(dObj + ".length");
        if(typeof(l) == "undefined") {
            eval(dObj).checked = !eval(dObj).checked;
        }
        else {
            for(var i = 0; i < l; i++) {
                if(!eval(dObj + "[" + i + "]").disabled) eval(dObj + "[" + i + "]").checked = !eval(dObj + "[" + i + "]").checked;
            }
        }
    }
    catch(e){}
}

/**
 * set to be selected
 * @param objStr
 * @param theValue
 * @return
 */
function set_select(objStr,theValue)
{
	var obj =eval(objStr);
	for(var i=0;i<obj.length;i++)
	{
		if(obj.options[i].value==theValue)
		{
			obj[i].selected = true ;
			return;
		}
	}
}


function mouseOver(obj)
{
	var obj1 = eval(obj);
	obj1.style.backgroundColor="#CCCCCC";
}
function mouseOut(obj)
{
	var obj1 = eval(obj);
	obj1.style.backgroundColor="";
}